package com.suotuo.module.sys.service.impl;

import com.suotuo.module.sys.dao.LogDAO;
import com.suotuo.module.sys.entity.SysLog;
import com.suotuo.module.sys.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

/**
 * @author liulubingjava@163.com
 * @date 2019/1/23 15:18
 */
@Service
public class LogServiceImpl implements LogService {
    @Autowired
    private LogDAO logDAO;
    @Override
    public void save(SysLog sysLog) {
        logDAO.save(sysLog);
    }

    @Override
    public void delete(Integer id) {
        logDAO.deleteById(id);
    }

    @Override
    public Page<SysLog> list() {
        PageRequest pageRequest = PageRequest.of(0,10);
        return logDAO.findAll(pageRequest);
    }

}
